<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

/**
 * HTML View class for the Monoslideshow Component
 *
 * @package    Monoslideshow
 * @subpackage Views
 */

class JmonoslideshowViewJmonoslideshow extends JView
{
	/**
	 * Monoslideshows view display method
	 * @return void
	 **/
	function display($tpl = null)
	{
		
		global $option;
		
		JToolBarHelper::title(   JText::_( 'COM_JMONOSLIDESHOW_CONTROL_PANEL' ), 'jmonoslideshow' );
		JToolBarHelper::preferences('com_jmonoslideshow', '500');
		
		//Load pane behavior
		jimport('joomla.html.pane');
			
		// activate the tooltips
		JHTML::_('behavior.tooltip');
		
		$user		= & JFactory::getUser();
		
		$pane   	= & JPane::getInstance('sliders');
		
		// push data into the template
		$this->assignRef('pane'			, $pane);
		$this->assignRef('user'			, $user);
		parent::display($tpl);
	}//function
	
	/**
	 * Creates the buttons view
	 *
	 * @param string $link targeturl
	 * @param string $image path to image
	 * @param string $text image description
	 * @param boolean $modal 1 for loading in modal
	 */
	function quickiconButton( $link, $image, $text, $modal = 0 )
	{
		//initialise variables
		
		$lang 		= & JFactory::getLanguage();
		$app = &JFactory::getApplication();
		$template	= $app->getTemplate();
  		?>

		<div style="float:<?php echo ($lang->isRTL()) ? 'right' : 'left'; ?>;">
			<div class="icon">
				<?php
				if ($modal == 1) {
					JHTML::_('behavior.modal');
				?>
					<a href="<?php echo $link; ?>" style="cursor:pointer" class="modal" rel="{handler: 'iframe', size: {x: 900, y: 500}}">
				<?php
				} elseif ($modal == 2)
				{ ?>
					<a href="#" onclick="<?php echo $link; ?>">
				<?php } else {
				?>
					<a href="<?php echo $link; ?>">
				<?php
				}
					
							echo '<img src= "'.JMONOSLIDESHOW_MEDIA_IMAGE_ADMIN.$image.'" alt="'.$text.'" title="'.$text.'"  />';
						
				?>
					<span><?php echo $text; ?></span>
				</a>
			</div>
		</div>
		<?php
	}

}//class